package db;

import java.util.ArrayList;

import javax.swing.plaf.basic.BasicInternalFrameTitlePane.RestoreAction;

import model.Client;
import model.MenuModele;
import model.Plat;
import model.Restaurant;

public class DataClass 
{
	static private boolean inited = false;
	
	static Plat p1 = new Plat("Plat 1", 9.99);
	static Plat p2 = new Plat("Plat 2", 19.99);
	static Plat p3 = new Plat("Plat 3", 29.99);
	static Plat p4 = new Plat("Plat 4", 4.99);
	static Plat p5 = new Plat("Plat 5", 1.99);
	static Plat p6 = new Plat("Plat 6", 11.99);
	
	static MenuModele m1 = new MenuModele("Super Menu 1");
	static MenuModele m2 = new MenuModele("Super Menu 2");
	static MenuModele m3 = new MenuModele("Super Menu 3");
	
	static Restaurant r1 = new Restaurant("resto-1");
	static Restaurant r2 = new Restaurant("resto-2");
	static Restaurant r3 = new Restaurant("resto-3");
	
	static ArrayList<Restaurant> restos = new ArrayList<Restaurant>();
	
	private static void init()
	{
		if(inited) return;
		
		m1.addPlat(p1);
		m1.addPlat(p2);
		
		m2.addPlat(p3);
		m2.addPlat(p4);
		
		m3.addPlat(p5);
		m3.addPlat(p6);
		
		r1.addMenu(m1);
		r2.addMenu(m2);
		r3.addMenu(m3);
		
		restos.clear();
		restos.add(r1);
		restos.add(r2);
		restos.add(r3);
		
		inited = true;
	}
	
	public static ArrayList<Restaurant> getRestaurants()
	{
		init();
		return restos;
	}
	
	public static int[] getOpeningHours()
	{
		int[] hours = { 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
		return hours;
	}
	
	public static Client getCurrentClient()
	{
		Client client = new Client();
		client.setNom("Clein");
		client.setPrenom("Calvin");
		client.setAdresse("2773, Ch. Belladress");
		client.setVille("Griffin Town");
		client.setTelephone("555-551-3322");
		return client;
	}
}
